#ifndef CUSTOMWINDOW_H
#define CUSTOMWINDOW_H

class CustomWindow;

#include "Utilities.h"
#include "Window.h"
#include "common.h"

class DLL CustomWindow : public Window
{
public:
	CustomWindow();
	virtual ~CustomWindow();

	virtual void Create(HINSTANCE hInstance, LPCTSTR className, WndProc ptr = 0, DWORD exStyle = 0, DWORD style = WS_OVERLAPPEDWINDOW, UINT classStyle = 0, HBRUSH hbrBackground = 0, HCURSOR hCursor = 0, HICON hIcon = 0, HWND hWndParent = 0, HMENU hMenu = 0, LPVOID lpParam = 0);
	void SetFrameMargins(int cxLeftWidth, int cxRightWidth, int cyTopHeight, int cyBottomHeight);
	void SetFrameMargins(int all);
	void SetFrameMargins(MARGINS m);
	MARGINS GetFrameMargins();
	void SetGlassMargins(int cxLeftWidth, int cxRightWidth, int cyTopHeight, int cyBottomHeight);
	void SetGlassMargins(int all);
	void SetGlassMargins(MARGINS m);
	MARGINS GetGlassMargins();
protected:
	MARGINS frameMargins;
	MARGINS glassMargins;

private:	

	WndProc wndProcPtr;


	static LRESULT HitTestNCA(HWND hWnd, WPARAM wParam, LPARAM lParam, MARGINS margins);
	static LRESULT CustomCaptionProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool* pCancel);
	static LRESULT CALLBACK WndProc(LPVOID sender, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
};

#endif
